//
//  InviteTipsAlertView.m
//  PigMarket
//
//  Created by mac on 2019/8/1.
//  Copyright © 2019 pigmarket.oc. All rights reserved.
//

#import "InviteTipsAlertView.h"

@interface InviteTipsAlertView ()
/**
 提示内容 绑定后您将与邀请人互相成为好友
 */
@property (nonatomic , strong) UILabel *tipsLab;

@end
@implementation InviteTipsAlertView

#pragma mark - init method
- (instancetype)init
{
    self = [super init];
    if (self) {
        [self initView];
        [self initLayout];
    }
    return self;
}

- (void)initView {
    // 添加子控件
    [self addSubview:self.tipsLab];
    [self addSubview:self.headImg];
    [self addSubview:self.nameLab];
    [self addSubview:self.idLab];
}

- (void)initLayout {
    // 布局子控件
    [self.tipsLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(0);
        make.height.mas_equalTo(26);
        make.centerX.mas_equalTo(self.mas_centerX);
    }];
    [self.headImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.tipsLab.mas_bottom).offset(30);
        make.size.mas_equalTo(CGSizeMake(70, 70));
        make.right.mas_equalTo(self).multipliedBy(0.5).offset(-20);
        make.bottom.mas_equalTo(0);
    }];
    [self.nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.tipsLab.mas_bottom).offset(40);
        make.height.mas_equalTo(22);
        make.right.mas_equalTo(-10);
        make.left.mas_equalTo(self.mas_centerX);
    }];
    [self.idLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.nameLab.mas_bottom).offset(8);
        make.height.mas_equalTo(20);
        make.right.mas_equalTo(-10);
        make.left.mas_equalTo(self.mas_centerX);
    }];
}

#pragma mark - getter and setter
- (UILabel *)tipsLab {
    if (!_tipsLab) {
        _tipsLab = [[UILabel alloc] init];
        _tipsLab.textColor = [UIColor colorWithHexString:@"#808080"];
        _tipsLab.font = [UIFont systemFontOfSize:13];
        _tipsLab.text = @"绑定后您将与邀请人互相成为好友";
    }
    return _tipsLab;
}
- (UIImageView *)headImg {
    if (!_headImg) {
        _headImg = [[UIImageView alloc] init];
        _headImg.layer.cornerRadius = 35;
        _headImg.layer.masksToBounds = YES;
    }
    return _headImg;
}
- (UILabel *)nameLab {
    if (!_nameLab) {
        _nameLab = [[UILabel alloc] init];
        _nameLab.textColor = [UIColor colorWithHexString:@"#363636"];
        _nameLab.font = [UIFont systemFontOfSize:16];
    }
    return _nameLab;
}
- (UILabel *)idLab {
    if (!_idLab) {
        _idLab = [[UILabel alloc] init];
        _idLab.textColor = [UIColor colorWithHexString:@"#808080"];
        _idLab.font = [UIFont systemFontOfSize:14];
    }
    return _idLab;
}
@end
